package com.imooc;

import com.imooc.dao.impl.BoyFriend;
import com.imooc.dao.impl.GirlFriend;
import org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory;
import org.springframework.beans.factory.support.AbstractBeanFactory;
import org.springframework.beans.factory.support.DefaultSingletonBeanRegistry;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <h1></h1>
 *
 * {@link AbstractBeanFactory#doGetBean(String, Class, Object[], boolean)}
 *
 *{@link DefaultSingletonBeanRegistry#getSingleton(String, boolean)}
 *  一级缓存, 完备的bean: {@link org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.singletonObjects}
 *  二级级缓存, 尚未初始化的bean: {@link org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.earlySingletonObjects}
 *  三级级缓存, objectFactory: {@link org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.singletonFactories}
 * @author : dzj
 * @create: 2022-05-12 07:57
 */
@Configuration
public class Debug0801_doGetBean {
	public static void main(String[] args) {
		ApplicationContext ctx = new AnnotationConfigApplicationContext(Debug0801_doGetBean.class);
		System.out.println("success");
	}
	@Bean
	BoyFriend boyFriend () {
		return new BoyFriend();
	}
	@Bean
	GirlFriend girlFriend () {
		return new GirlFriend();
	}
}
